<template>
    <div class="container">
      <div class="nav">
        <router-link to="/fenlei">
          <img src="../../assets/lyl/image/tuijian/BMQD-1.png" alt="">
        </router-link>
        <p>面部护理</p>
      </div>
      <div class="tanb">
        <p class="active">销量</p>
        <p>最新</p>
        <p class="pice">
          价格 <img class="shang" src="/static/lyl/1.png" alt="">
          <img class="xia" src="/static/lyl/2.png" alt="">
        </p>
        <router-link to="/shai">
          <p @click="changes()">筛选</p>
        </router-link>
      </div>
      <div class="faic" v-if="$route.params.id==sf&&sf!=0?true:false">
        <div v-for="(item,index) in arrs">{{item.tit}} <img @click="pops(index)" src="/static/lyl/xxx.png" alt=""></div>
        <span @click="qingkong()">清空</span>
      </div>
      <router-link to="/spxq" v-for="item in data2">
        <div @click="Bsf()" class="intro">
          <img :src="item.ri" alt="">
          <div class="right">
            <p>{{item.txt}}</p>
            <p>{{item.txt2}}</p>
            <div class="footu">
              <div class="lef">
                <img :src="item.ri2" alt="">
                <img :src="item.ri3" alt="">
                <span>海外直邮</span>
              </div>
              <p>￥166.06</p>
            </div>
          </div>
        </div>
      </router-link>

      <img class="footer" src="../../assets/lyl/image/huli/ssjg-9.png" alt="">

      <router-link v-if="bol" to="/mianxiang" v-for="item in data2">
        <div class="intro">
          <img :src="item.ri" alt="">
          <div class="right">
            <p>{{item.txt}}</p>
            <p>{{item.txt2}}</p>
            <div class="footu">
              <div class="lef">
                <img :src="item.ri2" alt="">
                <img :src="item.ri3" alt="">
                <span>海外直邮</span>
              </div>
              <p>￥166.06</p>
            </div>
          </div>
        </div>
      </router-link>
      <div class="more" @click="more()">加载更多</div>

      <router-view></router-view>
    </div>
</template>

<script>
  import Shai from './Shai'

    export default {
      name: "Mian",
      data(){
        return {
          sf:1,
          arrs:this.$store.state.arr,
          bol:false,
          data2:[
            {ri:require('../../assets/lyl/image/huli/ssjg-6.png'),txt:'焕彩萃璨花蕊唇彩4.8g',txt2:'焕彩萃璨花蕊唇彩4.8g焕彩萃璨花蕊唇彩4.8g 焕彩萃璨花蕊唇彩4.8g',ri2:require('../../assets/lyl/image/huli/ssjg-7.png'),ri3:require('../../assets/lyl/image/huli/ssjg-8.png'),},
            {ri:require('../../assets/lyl/image/huli/ssjg-6.png'),txt:'焕彩萃璨花蕊唇彩4.8g',txt2:'焕彩萃璨花蕊唇彩4.8g焕彩萃璨花蕊唇彩4.8g 焕彩萃璨花蕊唇彩4.8g',ri2:require('../../assets/lyl/image/huli/ssjg-7.png'),ri3:require('../../assets/lyl/image/huli/ssjg-8.png'),},
            {ri:require('../../assets/lyl/image/huli/ssjg-6.png'),txt:'焕彩萃璨花蕊唇彩4.8g',txt2:'焕彩萃璨花蕊唇彩4.8g焕彩萃璨花蕊唇彩4.8g 焕彩萃璨花蕊唇彩4.8g',ri2:require('../../assets/lyl/image/huli/ssjg-7.png'),ri3:require('../../assets/lyl/image/huli/ssjg-8.png'),},
            {ri:require('../../assets/lyl/image/huli/ssjg-6.png'),txt:'焕彩萃璨花蕊唇彩4.8g',txt2:'焕彩萃璨花蕊唇彩4.8g焕彩萃璨花蕊唇彩4.8g 焕彩萃璨花蕊唇彩4.8g',ri2:require('../../assets/lyl/image/huli/ssjg-7.png'),ri3:require('../../assets/lyl/image/huli/ssjg-8.png'),}
            ],
          cur:0
        }
      },
      methods:{
        more(){
          this.bol = true;
        },
        pops(i){
          this.$store.commit('dels',i);
          this.arrs = this.$store.state.arr;
          if (this.arrs.length==0){
            this.sf = 0;
          }
        },
        changes(){
          this.sf = 1;
        },
        qingkong(){
          this.$store.commit('alldel');
          this.sf = 0;
        },
        Bsf(){
          this.sf = 1;
        }
      },
      components:{
        Shai,
      }
    }
</script>

<style scoped>
  .container{
    position: relative;
    padding-top: 11rem;
    background: #f2f2f2;
  }
  .nav{
    position: fixed;
    top: 0;
    opacity: 0.8;
    width: 100%;
    background: #e53e42;
    padding: 3.5rem 0;
    display: flex;
    justify-content: center;
  }
  .nav a{
    position: absolute;
    left: 2rem;
    color: #fff;
    font-size: 34px;
  }
  .nav p{
    font-size: 34px;
    color:#fff;
  }
  .tanb{
    height: 8rem;
    line-height: 8rem;
    background: #f2f2f2;
    border-bottom: #ccc;
    display: flex;
    justify-content: space-around;
  }
  .tanb p{
    font-size: 30px;
    color:#4d4d4d;
  }
  .tanb .active{
    color:#e53e42;
  }
  .intro{
    background: #fff;
    border-bottom: 1px solid #ccc;
    margin-bottom: 2rem;
    padding: 2rem;
    display: flex;
  }
  .intro>img{
    width: 7.4rem;
    height: 15.6rem;
    margin:0.3rem 8rem 0 5.2rem;
  }
  .right>p:nth-child(1){
    font-size: 30px;
    line-height: 32px;
    margin-bottom: 2rem;
    font-weight: bolder;
  }
  .right>p:nth-child(2){
    font-size: 24px;
    line-height: 36px;
    color:#4d4d4d;
  }
  .right .footu{
    margin-top: 1.3rem;
    display: flex;
    justify-content: space-between;
  }
  .right .footu .lef img{
    width: 3.7rem;
    height: 3.2rem;
  }
  .right .footu .lef img:nth-child(1){
    width: 3rem;
    height: 2.1rem;
    margin-right: 2rem;
  }
  .right .footu .lef span{
    font-size: 24px;
    line-height: 32px;
  }
  .right .footu p{
    font-size: 30px;
    color:#e53e42;
  }
  .footer{
    width: 100%;
    height: 30.3rem;
  }
  .more{
    height: 7.3rem;
    text-align: center;
    line-height: 7.3rem;
    font-size: 24px;
    color: #808080;
  }
  .pice{
    position: relative;
    width: 7.5rem;
  }
  .shang{
     position: absolute;
     top: 3.5rem;
     right: 0;
  }
  .xia{
    position: absolute;
    bottom: 2.5rem;
    right: 0;
  }
  .faic{
    position: relative;
    padding:0 1.8rem 1.8rem 1.8rem;
    background: #fff;
    border-bottom: 1px solid #ccc;
    display: flex;
    flex-wrap: wrap;
  }
  .faic div{
    width: 16.1rem;
    height: 6.1rem;
    line-height: 6.1rem;
    text-align: center;
    font-size: 24px;
    background: #999;
    border-radius: 1rem;
    color:#fff;
    margin: 2rem 2rem 0 0;
  }
  .faic span{
    position: absolute;
    top: 1.8rem;
    right: 1.8rem;
    display: block;
    width: 9.8rem;
    height: 6.1rem;
    line-height: 6.1rem;
    text-align: center;
    font-size: 24px;
    border: 1px solid #4d4d4d;
    border-radius: 1rem;
  }
</style>
